﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class CreationForum : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {

        }
        else
        {

        }
    }


    protected void btnCreateForum_Click(object sender, EventArgs e)
    {
        CreateForum();
        Response.BufferOutput = true;
        Response.Redirect("Forums.aspx");
    }

    private void CreateForum()
    {
        string forumName = txtForumName.Text.Replace(" ", string.Empty);
        string description = txtRules.Text;
        Forum forum = new Forum(forumName, forumName + "Table", description);
        forum.CreateForum();
    }

}